﻿// -------------------------------------------------------------------------
//    @FileName         :    NFGlobalMiscData.h
//    @Author           :    gaoyi
//    @Date             :    24-8-22
//    @Email            :    445267987@qq.com
//    @Module           :    NFGlobalMiscData
//
// -------------------------------------------------------------------------

#pragma once

#include <NFServerComm/NFServerCommon/NFDBGlobalTemplate.h>

#include "proto_common_global.nanopb.h"
#include "NFComm/NFObjCommon/NFObject.h"
#include "NFLogicCommon/NFLogicShmTypeDefines.h"

class NFGlobalMiscData : public NFDBGlobalTemplate<NFGlobalMiscData, proto_ff::tbGlobalMiscData, EOT_LOGIC_GLOBAL_MISC_DATA_ID>
{
public:
    NFGlobalMiscData();

    virtual ~NFGlobalMiscData();

    int CreateInit();

    int ResumeInit();
public:
    int AfterAllConnectAndAllDescStore(NF_SERVER_TYPE serverType) override;
public:
    virtual int LoadFromDB(const proto_ff::tbGlobalMiscData &dbData);

    virtual int SaveToDB(proto_ff::tbGlobalMiscData &dbData);

    virtual int InitConfig();

    virtual int GetDbId();

public:
    tbGlobalMiscData *GetData() { return &m_stData; }
    PvP1v1GlobalData *GetPvPGlobalData() { return &m_stData.body.pvp_1v1_data; }
public:
    tbGlobalMiscData m_stData;
};
